import {fetchChannelsList, channels} from "./store/modules/channelsStore"
import {useEffect} from "react";
import {useDispatch, useSelector} from "react-redux";


function App() {
    const dispatch = useDispatch()
    const channelsList = useSelector(channels)
    useEffect(() => {
        dispatch(fetchChannelsList())
    }, [])

    return (
        <div className="App">
            <ul>
                {
                    channelsList.map(item => <li key={item.id}>{item.name}</li>)
                }
            </ul>
        </div>
    );
}

export default App;
